import { fontFamily, getCascaderData, lineType, bidirectional, ellipsoidConfiguration, BoxConfiguration, railfence, planeDirection, circleConfiguration } from "@/config/config";
import { ElMessage } from "element-plus";
const propertyEditor = (graphic: any) => {
    let type = graphic.options.plottingType;
    // console.log(type);
    // console.log(graphic, "321");
    switch (type) {
        case "ordinaryText":
            // 普通文字
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "文字信息",
                    item: text,
                },
                {
                    id: "3",
                    title: "位置及显示信息",
                    item: [...lnglat, ...rangeZoom, ...rangeShow, ...ground, ...shelter],
                },
            ];
        case "facadeText":
            // 立面文字
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "文字信息",
                    item: [...specialBasics, ...border, ...stroke, ...background],
                },
                {
                    id: "3",
                    title: "位置及显示信息",
                    item: [...rangeShow, ...ground, ...shelter],
                },
            ];
        case "rotateText":
            // 贴地旋转
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "文字信息",
                    item: [...specialBasics, ...stroke, ...background],
                },
                {
                    id: "3",
                    title: "位置及显示信息",
                    item: [...rangeShow, ...ground, ...shelter],
                },
            ];
        case "marqueeText":
            // 跑马文字
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "文字信息",
                    item: [...specialBasics, ...stroke, ...border, ...background, ...speed],
                },
                {
                    id: "3",
                    title: "位置及显示信息",
                    item: [...rangeShow, ...ground, ...shelter],
                },
            ];
        case "iconPoint":
            // 图标点
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "图标点的信息",
                    item: point,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...lnglat, ...rangeZoom, ...rangeShow, ...ground, ...shelter],
                },
            ];
        case "segment":
            // 线段
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "线段的信息",
                    item: segment,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlLength, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...rangeShow, ...ground, ...shelter],
                },
            ];
        case "curve":
            // 曲线
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "曲线的信息",
                    item: segment,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlLength, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...rangeShow, ...ground, ...shelter],
                },
            ];
        case "pipeline":
            // 管道
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                // {
                //     id: "2",
                //     title: "线段的信息",
                //     item: segment,
                // },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlLength, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...rangeShow, ...ground, ...shelter],
                },
            ];
        case "corridor":
            // 走廊
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "走廊的信息",
                    item: corridor,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlLength, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...rangeShow, ...ground, ...shelter],
                },
            ];
        case "rail":
            // 围栏
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "围栏的信息",
                    item: rail,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlLength, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...rangeShow, ...ground, ...shelter],
                },
            ];
        case "road":
            // 道路
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "道路的信息",
                    item: road,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlLength, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...rangeShow, ...ground, ...shelter],
                },
            ];
        case "plane":
            // 平面
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "平面的信息",
                    item: plane,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlArea, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...rangeShow, ...ground, ...shelter],
                },
            ];
        case "rectangle":
            // 矩形
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "矩形的信息",
                    item: rectangle,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlArea, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        case "polygon":
            // 多边形
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "多边形的信息",
                    item: rectangle,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [
                        ...controlText,
                        ...controlArea,
                        {
                            name: "面积单位",
                            prop: "unit",
                            type: "radio",
                            relyOn: "isArea",
                            dataLayer: "label",
                        },
                        ...controlProperty,
                    ],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        case "regular":
            // 正多边形
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "正多边形的信息",
                    item: regular,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlArea, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        case "circle":
            // 圆形
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "圆形的信息",
                    item: [...circleRadius, ...circle],
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlArea, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        case "sector":
            // 扇形
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "扇形的信息",
                    item: [...circleRadius, ...circle],
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlArea, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        case "ellipse":
            // 椭圆
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "椭圆的信息",
                    item: ellipse,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlArea, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        case "box":
            // 立体
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "立体的信息",
                    item: solid,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlVolume, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        case "column":
            // 圆柱
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "圆柱的信息",
                    item: [...cylinder, ...column],
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlVolume, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        case "ellipticCylinder":
            // 椭圆柱
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "椭圆柱的信息",
                    item: ellipticCylinder,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlVolume, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        case "cylinder":
            // 圆锥
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "圆锥的信息",
                    item: cylinderCap,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlVolume, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        case "ellipsoid":
            // 球及椭球
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "球及椭球的信息",
                    item: ellipsoid,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlVolume, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        case "radar":
            // 雷达及半球
            return [
                {
                    id: "1",
                    title: "标绘样式",
                    item: basics(),
                },
                {
                    id: "2",
                    title: "雷达及半球的信息",
                    item: ellipsoid,
                },
                {
                    id: "3",
                    title: "文字信息",
                    item: [...controlText, ...controlVolume, ...controlProperty],
                },
                {
                    id: "4",
                    title: "位置及显示信息",
                    item: [...ground, ...shelter],
                },
            ];
        default:
            ElMessage.error("该标绘类型正在调试中");
    }
};
export default propertyEditor;
/**
 * 基础属性
 */
// 基础属性*****************************************************************************************
const basics = () => {
    return [
        {
            name: "所在图层",
            prop: "folderId",
            dataLayer: "options",
            type: "cascader",
            selectOption: getCascaderData(),
            selectProps: {
                children: "children",
                label: "name",
                value: "id",
            },
        },
        {
            name: "绘标类型",
            prop: "plottingName",
            dataLayer: "options",
            type: "text",
        },
        {
            name: "样式名称",
            prop: "name",
            dataLayer: "options",
            type: "input",
        },
        // {
        //     name: "填充材质",
        //     prop: "",
        //     dataLayer: "options",
        //     type: "tip",
        // },
        {
            name: "绘标编号",
            prop: "number",
            dataLayer: "options",
            type: "text",
        },
        {
            name: "绘标图标",
            prop: "icon",
            dataLayer: "options",
            type: "upload",
        },
    ];
};

/**
 * 文字属性*****************************************************************************************
 */
// 普通文本属性
const text: any = [
    {
        name: "文字内容",
        prop: "text",
        type: "input",
        dataLayer: "style",
    },
    {
        name: "字体",
        prop: "font_family",
        type: "select",
        selectOption: fontFamily,
        dataLayer: "style",
    },
    {
        name: "字体大小",
        prop: "font_size",
        type: "number",
        numberStep: 1,
        numberMin: 10,
        dataLayer: "style",
    },
    {
        name: "是否加粗",
        prop: "font_weight",
        type: "switch",
        activeValue: "bold",
        inactiveValue: "normal",
        dataLayer: "style",
    },
    {
        name: "是否斜体",
        prop: "font_style",
        type: "switch",
        activeValue: "italic",
        inactiveValue: "normal",
        dataLayer: "style",
    },
    {
        name: "颜色",
        prop: "color",
        type: "color",
        dataLayer: "style",
    },
    {
        name: "是否衬色",
        prop: "outline",
        type: "switch",
        activeValue: true,
        inactiveValue: false,
        dataLayer: "style",
    },
    {
        name: "衬色颜色",
        prop: "outlineColor",
        type: "color",
        relyOn: "outline",
        dataLayer: "style",
    },
    {
        name: "是否背景",
        prop: "background",
        type: "switch",
        dataLayer: "style",
    },
    {
        name: "背景颜色",
        prop: "backgroundColor",
        type: "color",
        relyOn: "background",
        dataLayer: "style",
    },
];
// 特殊属性
const specialBasics: any = [
    {
        name: "文字内容",
        prop: "text",
        type: "input",
        dataLayer: "materialOptions",
    },
    {
        name: "字体",
        prop: "font_family",
        type: "select",
        selectOption: fontFamily,
        dataLayer: "materialOptions",
    },
    {
        name: "字体大小",
        prop: "font_size",
        type: "number",
        numberStep: 1,
        numberMin: 10,
        dataLayer: "materialOptions",
    },
    {
        name: "是否加粗",
        prop: "font_weight",
        type: "switch",
        activeValue: "bold",
        inactiveValue: "normal",
        dataLayer: "materialOptions",
    },
    {
        name: "是否斜体",
        prop: "font_style",
        type: "switch",
        activeValue: "italic",
        inactiveValue: "normal",
        dataLayer: "materialOptions",
    },
    {
        name: "颜色",
        prop: "color",
        type: "color",
        dataLayer: "materialOptions",
    },
];
// 边框
const border: any = [
    {
        name: "是否边框",
        prop: "outline",
        type: "switch",
        activeValue: true,
        inactiveValue: false,
        dataLayer: "style",
    },
    {
        name: "边框宽度",
        prop: "outlineWidth",
        type: "number",
        relyOn: "outline",
        numberStep: 1,
        numberMin: 1,
        dataLayer: "style",
    },
    {
        name: "边框颜色",
        prop: "outlineColor",
        relyOn: "outline",
        type: "color",
        dataLayer: "style",
    },
];
// 描边
const stroke: any = [
    {
        name: "是否描边",
        prop: "stroke",
        type: "switch",
        activeValue: true,
        inactiveValue: false,
        dataLayer: "materialOptions",
    },
    {
        name: "描边颜色",
        prop: "strokeColor",
        relyOn: "stroke",
        type: "color",
        dataLayer: "materialOptions",
    },
    {
        name: "描边宽度",
        prop: "strokeWidth",
        type: "number",
        relyOn: "stroke",
        numberStep: 1,
        numberMin: 1,
        dataLayer: "materialOptions",
    },
];
// 背景
const background: any = [
    {
        name: "是否背景",
        prop: "background",
        type: "switch",
        activeValue: true,
        inactiveValue: false,
        dataLayer: "materialOptions",
    },
    {
        name: "背景颜色",
        prop: "backgroundColor",
        relyOn: "background",
        type: "color",
        dataLayer: "materialOptions",
    },
    {
        name: "内边距",
        prop: "backgroundPadding",
        relyOn: "background",
        type: "number",
        numberStep: 1,
        numberMin: 0,
        dataLayer: "materialOptions",
    },
];
// 跑马文字
const speed: any = [
    {
        name: "速度",
        prop: "speed",
        type: "number",
        dataLayer: "materialOptions",
    },
];
/**
 * 能控制的文字属性
 */
const controlText: any = [
    {
        name: "是否文字",
        prop: "isLabel",
        type: "switch",
        activeValue: true,
        inactiveValue: false,
        dataLayer: "label",
    },
];
const controlLength: any = [
    {
        name: "是否长度",
        prop: "isLength",
        type: "switch",
        activeValue: true,
        inactiveValue: false,
        dataLayer: "label",
    },
];
const controlArea: any = [
    {
        name: "是否面积",
        prop: "isArea",
        type: "switch",
        activeValue: true,
        inactiveValue: false,
        dataLayer: "label",
    },
];
const controlVolume: any = [
    {
        name: "是否体积",
        prop: "isVolume",
        type: "switch",
        activeValue: true,
        inactiveValue: false,
        dataLayer: "label",
    },
];
// 需要控制的属性
const controlProperty: any = [
    {
        name: "文字内容",
        prop: "text",
        type: "input",
        relyOn: "isLabel",
        dataLayer: "label",
    },
    {
        name: "长度",
        prop: "text",
        type: "text",
        relyOn: "isLength",
        dataLayer: "label",
    },
    {
        name: "面积",
        prop: "text",
        type: "text",
        relyOn: "isArea",
        dataLayer: "label",
    },
    {
        name: "体积",
        prop: "text",
        type: "text",
        relyOn: "isVolume",
        dataLayer: "label",
    },
    {
        name: "字体",
        prop: "font_family",
        type: "select",
        relyOn: "isLabel,isLength,isArea,isVolume",
        selectOption: fontFamily,
        dataLayer: "label",
    },
    {
        name: "字体大小",
        prop: "font_size",
        type: "number",
        relyOn: "isLabel,isLength,isArea,isVolume",
        numberStep: 1,
        numberMin: 10,
        dataLayer: "label",
    },
    {
        name: "是否加粗",
        prop: "font_weight",
        type: "switch",
        relyOn: "isLabel,isLength,isArea,isVolume",
        activeValue: "bold",
        inactiveValue: "normal",
        dataLayer: "label",
    },
    {
        name: "是否斜体",
        prop: "font_style",
        type: "switch",
        relyOn: "isLabel,isLength,isArea,isVolume",
        activeValue: "italic",
        inactiveValue: "normal",
        dataLayer: "label",
    },
    {
        name: "颜色",
        prop: "color",
        type: "color",
        relyOn: "isLabel,isLength,isArea,isVolume",
        dataLayer: "label",
    },
    {
        name: "是否衬色",
        prop: "outline",
        type: "switch",
        relyOn: "isLabel,isLength,isArea,isVolume",
        activeValue: true,
        inactiveValue: false,
        dataLayer: "label",
    },
    {
        name: "衬色颜色",
        prop: "outlineColor",
        relyOn: "outline",
        type: "color",
        dataLayer: "label",
    },
    {
        name: "衬色宽度",
        prop: "outlineWidth",
        type: "number",
        relyOn: "outline",
        numberStep: 1,
        numberMin: 1,
        dataLayer: "label",
    },
    {
        name: "是否背景",
        prop: "background",
        type: "switch",
        relyOn: "isLabel,isLength,isArea,isVolume",
        activeValue: true,
        inactiveValue: false,
        dataLayer: "label",
    },
    {
        name: "背景颜色",
        prop: "backgroundColor",
        relyOn: "background",
        type: "color",
        dataLayer: "label",
    },
    {
        name: "是否偏移",
        prop: "hasPixelOffset",
        type: "switch",
        relyOn: "isLabel,isLength,isArea,isVolume",
        dataLayer: "label",
    },
    {
        name: "横向偏移",
        prop: "pixelOffsetX",
        type: "number",
        relyOn: "hasPixelOffset",
        numberStep: 1,
        numberMin: undefined,
        dataLayer: "label",
    },
    {
        name: "纵向偏移",
        prop: "pixelOffsetY",
        relyOn: "hasPixelOffset",
        type: "number",
        numberStep: 1,
        numberMin: undefined,
        dataLayer: "label",
    },
    {
        name: "按视距缩放",
        prop: "scaleByDistance",
        type: "switch",
        relyOn: "isLabel,isLength,isArea,isVolume",
        dataLayer: "label",
    },
    {
        name: "上限",
        prop: "scaleByDistance_far",
        relyOn: "scaleByDistance",
        type: "number",
        numberStep: 1,
        numberMin: undefined,
        dataLayer: "label",
    },
    {
        name: "比例值",
        prop: "scaleByDistance_farValue",
        relyOn: "scaleByDistance",
        type: "number",
        numberStep: 1,
        numberMin: undefined,
        dataLayer: "label",
    },
    {
        name: "下限",
        prop: "scaleByDistance_near",
        relyOn: "scaleByDistance",
        type: "number",
        numberStep: 1,
        numberMin: undefined,
        dataLayer: "label",
    },
    {
        name: "比例值",
        prop: "scaleByDistance_nearValue",
        relyOn: "scaleByDistance",
        type: "number",
        numberStep: 1,
        numberMin: undefined,
        dataLayer: "label",
    },
    {
        name: "按视距显示",
        prop: "distanceDisplayCondition",
        type: "switch",
        relyOn: "isLabel,isLength,isArea,isVolume",
        dataLayer: "label",
    },
    {
        name: "最大距离",
        prop: "distanceDisplayCondition_far",
        relyOn: "distanceDisplayCondition",
        type: "number",
        numberStep: 1,
        numberMin: undefined,
        dataLayer: "label",
    },
    {
        name: "比例值",
        prop: "distanceDisplayCondition_near",
        relyOn: "distanceDisplayCondition",
        type: "number",
        numberStep: 1,
        numberMin: undefined,
        dataLayer: "label",
    },
    {
        name: "是否贴地",
        prop: "clampToGround",
        type: "switch",
        relyOn: "isLabel,isLength,isArea,isVolume",
        dataLayer: "label",
    },
];
/**
 * 底部属性*****************************************************************************************
 */
// 经纬度
const lnglat: any = [
    {
        name: "经度",
        prop: "lng",
        type: "text",
        dataLayer: "point",
    },
    {
        name: "纬度",
        prop: "lat",
        type: "text",
        dataLayer: "point",
    },
    {
        name: "海拔高度",
        prop: "alt",
        type: "text",
        unit: "米",
        dataLayer: "point",
    },
];
// 视距缩放
const rangeZoom: any = [
    {
        name: "是否按视距缩放",
        prop: "scaleByDistance",
        type: "switch",
        dataLayer: "style",
    },
    {
        name: "上限",
        prop: "scaleByDistance_far",
        type: "number",
        relyOn: "scaleByDistance",
        numberStep: 1,
        numberMin: 1,
        dataLayer: "style",
    },
    {
        name: "比例值",
        prop: "scaleByDistance_farValue",
        type: "number",
        relyOn: "scaleByDistance",
        numberStep: 0.1,
        numberMin: 0,
        dataLayer: "style",
    },
    {
        name: "下限",
        prop: "scaleByDistance_near",
        type: "number",
        relyOn: "scaleByDistance",
        numberStep: 1,
        numberMin: 1,
        dataLayer: "style",
    },
    {
        name: "比例值",
        prop: "scaleByDistance_nearValue",
        type: "number",
        relyOn: "scaleByDistance",
        numberStep: 0.1,
        numberMin: 0,
        dataLayer: "style",
    },
];
// 视距显示
const rangeShow: any = [
    {
        name: "是否按视距显示",
        prop: "distanceDisplayCondition",
        type: "switch",
        dataLayer: "style",
    },
    {
        name: "最大距离",
        prop: "distanceDisplayCondition_far",
        type: "number",
        relyOn: "distanceDisplayCondition",
        numberStep: 1,
        numberMin: 1,
        dataLayer: "style",
    },
    {
        name: "最小距离",
        prop: "distanceDisplayCondition_near",
        type: "number",
        relyOn: "distanceDisplayCondition",
        numberStep: 1,
        numberMin: 0,
        dataLayer: "style",
    },
];
// 是否贴地
const ground: any = [
    {
        name: "是否贴地",
        prop: "clampToGround",
        type: "switch",
        dataLayer: "style",
    },
];
// 是否被遮挡
const shelter: any = [
    {
        name: "是否被遮挡",
        prop: "visibleDepth",
        type: "switch",
        dataLayer: "style",
    },
];
/**
 * 图标点*****************************************************************************************
 */
const point: any = [
    {
        name: "图标",
        prop: "image",
        type: "upload",
        dataLayer: "style",
    },
    {
        name: "大小比例",
        prop: "scale",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "旋转角度",
        prop: "rotationDegree",
        type: "number",
        numberStep: 0.1,
        numberMin: 0,
        dataLayer: "style",
    },
];
// 是否填充
const fill: any = (materialType: any) => {
    return [
        {
            name: "是否填充",
            prop: "fill",
            type: "switch",
            dataLayer: "style",
        },
        {
            name: "填充材质",
            prop: "materialType",
            type: "select",
            relyOn: "fill",
            selectOption: materialType ? materialType : railfence,
            dataLayer: "style",
        },
        {
            name: "颜色",
            prop: "color",
            type: "color",
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "Color",
            dataLayer: "materialOptions",
        },
        {
            name: "填充透明度",
            prop: "cellAlpha",
            type: "number",
            numberStep: 0.1,
            numberMin: 0.1,
            numberMax: 1,
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "Grid",
            dataLayer: "materialOptions",
        },
        {
            name: "网格数量",
            prop: "lineCount",
            type: "number",
            numberStep: 0.1,
            numberMin: 0.1,
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "Grid",
            dataLayer: "materialOptions",
        },
        {
            name: "网格宽度",
            prop: "lineThickness",
            type: "number",
            numberStep: 0.1,
            numberMin: 0.1,
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "Grid",
            dataLayer: "materialOptions",
        },
        {
            name: "速度",
            prop: "speed",
            type: "number",
            numberStep: 0.1,
            numberMin: 0.1,
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "ScanLine",
            dataLayer: "materialOptions",
        },
        {
            name: "数量",
            prop: "count",
            type: "number",
            numberStep: 1,
            numberMin: 1,
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "CircleWave",
            dataLayer: "materialOptions",
        },
        {
            name: "圈间系数",
            prop: "gradient",
            type: "number",
            numberStep: 0.1,
            numberMin: 0.1,
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "CircleWave",
            dataLayer: "materialOptions",
        },
        {
            name: "速度",
            prop: "speed",
            type: "number",
            numberStep: 1,
            numberMin: 1,
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "CircleWave",
            dataLayer: "materialOptions",
        },
        {
            name: "主色",
            prop: "evenColor",
            type: "color",
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "Checkerboard",
            dataLayer: "materialOptions",
        },
        {
            name: "衬色",
            prop: "oddColor",
            type: "color",
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "Checkerboard",
            dataLayer: "materialOptions",
        },
        {
            name: "数量",
            prop: "repeat",
            type: "number",
            numberStep: 1,
            numberMin: 1,
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "Checkerboard",
            dataLayer: "materialOptions",
        },
        {
            name: "速度",
            prop: "speed",
            type: "number",
            numberStep: 1,
            numberMin: 1,
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "EllipsoidElectric",
            dataLayer: "materialOptions",
        },
        {
            name: "速度",
            prop: "speed",
            type: "number",
            numberStep: 1,
            numberMin: 1,
            relyOn: "materialType",
            skipLevel: true,
            skipLevelName: "fill",
            property: "EllipsoidWave",
            dataLayer: "materialOptions",
        },
    ];
};

/**
 * 线段-曲线
 */
const segment: any = [
    {
        name: "线宽",
        prop: "width",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "线型",
        prop: "materialType",
        type: "select",
        selectOption: lineType,
        dataLayer: "style",
    },
    {
        name: "颜色",
        prop: "color",
        type: "color",
        dataLayer: "materialOptions",
    },
    // 虚线
    {
        name: "间隔颜色",
        prop: "gapColor",
        type: "color",
        relyOn: "materialType",
        property: "PolylineDash",
        dataLayer: "materialOptions",
    },
    {
        name: "虚线间隔",
        prop: "dashLength",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        relyOn: "materialType",
        property: "PolylineDash",
        dataLayer: "materialOptions",
    },
    // 衬色线
    {
        name: "衬色颜色",
        prop: "outlineColor",
        type: "color",
        relyOn: "materialType",
        property: "PolylineOutline",
        dataLayer: "materialOptions",
    },
    {
        name: "衬色宽度",
        prop: "outlineWidth",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        relyOn: "materialType",
        property: "PolylineOutline",
        dataLayer: "materialOptions",
    },
    // OD线
    {
        name: "背景颜色",
        prop: "bgColor",
        type: "color",
        relyOn: "materialType",
        property: "ODLine",
        dataLayer: "materialOptions",
    },
    {
        name: "速度",
        prop: "speed",
        type: "number",
        numberStep: 1,
        numberMin: 1,
        relyOn: "materialType",
        property: "ODLine",
        dataLayer: "materialOptions",
    },
    {
        name: "运行形式",
        prop: "bidirectional",
        type: "select",
        relyOn: "materialType",
        property: "ODLine",
        selectOption: bidirectional,
        dataLayer: "materialOptions",
    },
];
/**
 * 走廊
 */
const corridor: any = [
    {
        name: "高程",
        prop: "height",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "立体高度",
        prop: "diffHeight",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "走廊宽度",
        prop: "width",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "纯色填充",
        prop: "color",
        type: "color",
        dataLayer: "style",
    },
    ...border,
];
/**
 * 围栏
 */
const rail: any = [
    {
        name: "墙高",
        prop: "diffHeight",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    ...fill(railfence),
    {
        name: "是否闭合",
        prop: "closure",
        type: "switch",
        dataLayer: "style",
    },
    ...border,
];
/**
 * 道路
 */
const road: any = [
    {
        name: "道路宽度",
        prop: "width",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "道路图片",
        prop: "image",
        type: "upload",
        dataLayer: "style",
    },
];
/**
 * 平面
 */
const plane: any = [
    {
        name: "长度",
        prop: "dimensions_x",
        type: "number",
        numberStep: 1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "宽度",
        prop: "dimensions_y",
        type: "number",
        numberStep: 1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "方向",
        prop: "plane_normal",
        type: "select",
        selectOption: planeDirection,
        dataLayer: "style",
    },
    {
        name: "偏移距离",
        prop: "plane_distance",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "方向角",
        prop: "heading",
        type: "number",
        numberStep: 1,
        numberMin: -360,
        numberMax: 360,
        dataLayer: "style",
    },
    {
        name: "俯仰角",
        prop: "pitch",
        type: "number",
        numberStep: 1,
        numberMin: -360,
        numberMax: 360,
        dataLayer: "style",
    },
    {
        name: "翻滚角",
        prop: "roll",
        type: "number",
        numberStep: 1,
        numberMin: -360,
        numberMax: 360,
        dataLayer: "style",
    },
    ...fill(railfence),
    ...border,
];
/**
 * 矩形
 */
const rectangle: any = [...fill(railfence), ...border];
/**
 * 圆形 - 扇形 - 椭圆
 */
const circleRadius: any = [
    {
        name: "半径",
        prop: "radius",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
];
const circle: any = [...fill(circleConfiguration), ...border];
/**
 * 椭圆
 */
const ellipse: any = [
    {
        name: "短半径",
        prop: "semiMinorAxis",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
    {
        name: "长半径",
        prop: "semiMajorAxis",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
    ...circle,
];
/**
 * 立体
 */
const solid: any = [
    {
        name: "长度",
        prop: "dimensions_x",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "宽度",
        prop: "dimensions_y",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "高度",
        prop: "dimensions_z",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "方向角",
        prop: "heading",
        type: "number",
        numberStep: 0.1,
        numberMin: -360,
        dataLayer: "style",
    },
    {
        name: "俯仰角",
        prop: "pitch",
        type: "number",
        numberStep: 0.1,
        numberMin: -360,
        dataLayer: "style",
    },
    {
        name: "翻滚角",
        prop: "roll",
        type: "number",
        numberStep: 0.1,
        numberMin: -360,
        dataLayer: "style",
    },
    ...fill(BoxConfiguration),
];
/**
 *  圆柱
 */
const cylinder: any = [
    {
        name: "圆柱半径",
        prop: "radius",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
];
const column: any = [
    {
        name: "离地高度",
        prop: "height",
        type: "number",
        numberStep: 0.1,
        numberMin: 0,
        dataLayer: "style",
    },
    {
        name: "立体高度",
        prop: "diffHeight",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    ...circle,
];
/**
 * 椭圆柱
 */
const ellipticCylinder: any = [
    {
        name: "短半径",
        prop: "semiMinorAxis",
        type: "text",
        dataLayer: "style",
    },
    {
        name: "长半径",
        prop: "semiMajorAxis",
        type: "text",
        dataLayer: "style",
    },
    ...column,
];
/**
 * 圆锥
 */
const cylinderCap: any = [
    {
        name: "顶部半径",
        prop: "topRadius",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
    {
        name: "底部半径",
        prop: "bottomRadius",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
    {
        name: "锥体高度",
        prop: "length",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
    {
        name: "方向角",
        prop: "heading",
        type: "number",
        numberStep: 1,
        numberMin: -360,
        numberMax: 360,
        dataLayer: "style",
    },
    {
        name: "仰俯角",
        prop: "pitch",
        type: "number",
        numberStep: 1,
        numberMin: -360,
        numberMax: 360,
        dataLayer: "style",
    },
    {
        name: "翻滚角",
        prop: "roll",
        type: "number",
        numberStep: 1,
        numberMin: -360,
        numberMax: 360,
        dataLayer: "style",
    },
    ...circle,
];
/**
 * 球及椭球 - 雷达及半球
 */

/**
 * 填充材质
 */
const ellipsoidMaterialType: any = [
    ...fill(ellipsoidConfiguration),
    // {
    //     name: "是否填充",
    //     prop: "fill",
    //     type: "switch",
    //     dataLayer: "style",
    // },
    // {
    //     name: "填充材质",
    //     prop: "materialType",
    //     type: "select",
    //     selectOption: ellipsoidConfiguration,
    //     dataLayer: "style",
    // },
    // {
    //     name: "颜色",
    //     prop: "color",
    //     type: "color",
    //     dataLayer: "materialOptions",
    // },
    // {
    //     name: "速度",
    //     prop: "speed",
    //     type: "number",
    //     numberStep: 0.1,
    //     numberMin: 0.1,
    //     relyOn: "materialType",
    //     property: "ScanLine",
    //     dataLayer: "materialOptions",
    // },
    // {
    //     name: "数量",
    //     prop: "count",
    //     type: "number",
    //     numberStep: 1,
    //     numberMin: 1,
    //     relyOn: "materialType",
    //     property: "CircleWave",
    //     dataLayer: "materialOptions",
    // },
    // {
    //     name: "圈间系数",
    //     prop: "gradient",
    //     type: "number",
    //     numberStep: 0.1,
    //     numberMin: 0.1,
    //     relyOn: "materialType",
    //     property: "CircleWave",
    //     dataLayer: "materialOptions",
    // },
    // {
    //     name: "速度",
    //     prop: "speed",
    //     type: "number",
    //     numberStep: 1,
    //     numberMin: 1,
    //     relyOn: "materialType",
    //     property: "CircleWave",
    //     dataLayer: "materialOptions",
    // },
    // {
    //     name: "速度",
    //     prop: "speed",
    //     type: "number",
    //     numberStep: 1,
    //     numberMin: 1,
    //     relyOn: "materialType",
    //     property: "EllipsoidElectric",
    //     dataLayer: "materialOptions",
    // },
    // {
    //     name: "速度",
    //     prop: "speed",
    //     type: "number",
    //     numberStep: 1,
    //     numberMin: 1,
    //     relyOn: "materialType",
    //     property: "EllipsoidWave",
    //     dataLayer: "materialOptions",
    // },
];
const ellipsoid: any = [
    {
        name: "X半径",
        prop: "radii_x",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
    {
        name: "Y半径",
        prop: "radii_y",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
    {
        name: "Z半径",
        prop: "radii_z",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
    {
        name: "内部X半径",
        prop: "innerRadii_x",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
    {
        name: "内部Y半径",
        prop: "innerRadii_y",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
    {
        name: "内部Z半径",
        prop: "innerRadii_z",
        type: "text",
        unit: "m",
        dataLayer: "style",
    },
    {
        name: "最小时钟角",
        prop: "minimumClockDegree",
        type: "number",
        numberStep: 1,
        numberMin: 0,
        numberMax: 360,
        dataLayer: "style",
    },
    {
        name: "最大时钟角",
        prop: "maximumClockDegree",
        type: "number",
        numberStep: 1,
        numberMin: 0,
        numberMax: 360,
        dataLayer: "style",
    },
    {
        name: "最小锥角",
        prop: "minimumConeDegree",
        type: "number",
        numberStep: 1,
        numberMin: 0,
        numberMax: 360,
        dataLayer: "style",
    },
    {
        name: "最大锥角",
        prop: "maximumConeDegree",
        type: "number",
        numberStep: 1,
        numberMin: 0,
        numberMax: 360,
        dataLayer: "style",
    },
    {
        name: "方向角",
        prop: "heading",
        type: "number",
        numberStep: 1,
        numberMin: -360,
        numberMax: 360,
        dataLayer: "style",
    },
    {
        name: "仰俯角",
        prop: "pitch",
        type: "number",
        numberStep: 1,
        numberMin: -360,
        numberMax: 360,
        dataLayer: "style",
    },
    {
        name: "翻滚角",
        prop: "roll",
        type: "number",
        numberStep: 1,
        numberMin: -360,
        numberMax: 360,
        dataLayer: "style",
    },
    ...ellipsoidMaterialType,
];
/**
 * 正多边形
 */
const regular: any = [
    {
        name: "多边形边数",
        prop: "border",
        type: "number",
        numberStep: 1,
        numberMin: 3,
        dataLayer: "style",
    },
    {
        name: "半径",
        prop: "radius",
        type: "text",
        numberStep: 0.1,
        numberMin: 0.1,
        unit: "m",
        dataLayer: "style",
    },
    {
        name: "立体高度",
        prop: "diffHeight",
        type: "number",
        numberStep: 0.1,
        numberMin: 0.1,
        dataLayer: "style",
    },
    {
        name: "角度",
        prop: "startAngle",
        type: "number",
        numberStep: 1,
        numberMin: -360,
        numberMax: 360,
        dataLayer: "style",
    },
    ...rectangle,
];
